package model

import "langtu.com/common/lang"

type State int

const (
	Waiting    State = iota
	Processing State = iota
	Success    State = iota
	Fail       State = iota
)

// Text
//
//	@Description: 	状态文本
//	@receiver s
//	@return string
func (s State) Text() string {
	StateTexts := []string{"等待", "处理中", "成功", "失败"}
	return StateTexts[s]
}

// ListAll
//
//	@Description:  获取全部
//	@return []lang.IdText
func ListAll() []lang.IdText {
	listValue := make([]lang.IdText, 0)
	listValue = append(listValue, lang.NewIdText(int(Waiting), Waiting.Text()))
	listValue = append(listValue, lang.NewIdText(int(Processing), Waiting.Text()))
	listValue = append(listValue, lang.NewIdText(int(Success), Waiting.Text()))
	listValue = append(listValue, lang.NewIdText(int(Fail), Waiting.Text()))
	return listValue
}
